@extends('departmentManagement.business.layouts')
@section('style')
    <meta name="_token" content="{{ csrf_token() }}"/>
    <style>
        .claim-th {
            text-align: center;
            color: #676767;
        }

        .claim-td {
            text-align: center;
            color: #676767;
        }
    </style>
    <link rel="stylesheet" href="{{asset('admin_assets/css/ip.css')}}">
    <link rel="stylesheet" href="{{url('css/search.css')}}">
@stop
@section('content')
    <div class="content-wrapper" style="background-color: white">
        <section class="content">
            <div class="row">
                <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
                    <div class="box box-info"
                         style="padding-top: 0px;margin-top: 0px;border-top: 0px;border-bottom: solid 1px #0080ff;">
                        <div class="box-body" style="">
                            <div class="row">
                                <div class="col-lg-2 col-md-2 col-sm-12 col-xs-12" style="margin-top: 0.5vw">
                                    <a href="#" title="返回首页" style="float: left"><i class="fa fa-home fa-2x"
                                                                                    style="width: 100%;color: #0080FF">
                                        </i></a>
                                    <a href="{{url('management/business/claim')}}"><span
                                                style="font-size: 18px;float: left">&nbsp;业务认领中心</span></a>
                                    <div class="clear"></div>
                                </div>
                                <div class="col-lg-2 col-md-2 col-sm-12 col-xs-12  col-lg-offset-8 col-md-offset-8">
                                    <form action="{{url('management/business/claimSearch')}}" method="post" enctype="multipart/form-data" class="search">
                                        {{csrf_field()}}
                                        <input type="search" id="search-input" name="search">
                                        <button class="fa fa-search fa-lg"></button>
                                    </form>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            @include('public/alert')
            <div class="row">
                <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
                    <div class="table-responsive">
                        <table class="table table-bordered">
                            <thead>
                            <tr>
                                <th class="claim-th">编号</th>
                                <th class="claim-th">公司</th>
                                <th class="claim-th">任务类别</th>
                                <th class="claim-th">类型</th>
                                <th class="claim-th">申请人</th>
                                <th class="claim-th">联系电话</th>
                                <th class="claim-th">申请日期</th>
                                <th class="claim-th">操作</th>
                            </tr>
                            </thead>
                            <tbody>
                            @if($product->isEmpty())
                                <tr>
                                    <td class="claim-td" colspan="7"><h3 align="center">暂无数据</h3></td>
                                </tr>
                            @else
                                @foreach($product as $k =>$c)
                                    @php($v=$c['Product'])
                                    @if(!empty($v))
                                        <tr>
                                            <td class="claim-td">{{$k+1}}</td>
                                            <td class="claim-td">{{$v['company']}}</td>
                                            <td class="claim-td">
                                                @if($c['is_renew']==0)
                                                    首次任务
                                                @else
                                                    续费任务
                                                @endif
                                            </td>
                                            <td class="claim-td">{{$v['FirstType']['name']}}</td>
                                            <td class="claim-td">{{$v['applicant']}}</td>
                                            <td class="claim-td">{{$v['phone']}}</td>
                                            <td class="claim-td">{{date("Y-m-d",strtotime($v['created_at']))}}</td>
                                            <td class="claim-td">
                                                <a href="{{url('management/business/doClaim',['id'=>$v['id'],'pid'=>$c['id']])}}">认领</a>
                                            </td>
                                        </tr>
                                    @endif
                                @endforeach
                            @endif
                            </tbody>

                        </table>
                        <div class="btn-page">
                            {!! $product->links() !!}
                        </div>

                    </div>

                </div>
            </div>
        </section>
    </div>
@stop
@section('javascript')
@stop
